

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#lwip/opt.h" class="nav-sub-label">lwip/opt.h</a>
              </li>
      

              <li>
                <a href="#lwip/err.h" class="nav-sub-label">lwip/err.h</a>
              </li>
      

              <li>
                <a href="#arch/sys_arch.h" class="nav-sub-label">arch/sys_arch.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#LWIP_HDR_SYS_H" class="nav-sub-label">LWIP_HDR_SYS_H</a>
              </li>
      

              <li>
                <a href="#sys_sem_new(s, c)" class="nav-sub-label">sys_sem_new(s, c)</a>
              </li>
      

              <li>
                <a href="#sys_sem_signal" class="nav-sub-label">sys_sem_signal</a>
              </li>
      

              <li>
                <a href="#sys_sem_wait" class="nav-sub-label">sys_sem_wait</a>
              </li>
      

              <li>
                <a href="#sys_arch_sem_wait" class="nav-sub-label">sys_arch_sem_wait</a>
              </li>
      

              <li>
                <a href="#sys_sem_free" class="nav-sub-label">sys_sem_free</a>
              </li>
      

              <li>
                <a href="#sys_sem_valid(s)" class="nav-sub-label">sys_sem_valid(s)</a>
              </li>
      

              <li>
                <a href="#sys_sem_valid_val(s)" class="nav-sub-label">sys_sem_valid_val(s)</a>
              </li>
      

              <li>
                <a href="#sys_sem_set_invalid" class="nav-sub-label">sys_sem_set_invalid</a>
              </li>
      

              <li>
                <a href="#sys_sem_set_invalid_val" class="nav-sub-label">sys_sem_set_invalid_val</a>
              </li>
      

              <li>
                <a href="#sys_mutex_new(mu)" class="nav-sub-label">sys_mutex_new(mu)</a>
              </li>
      

              <li>
                <a href="#sys_mutex_lock" class="nav-sub-label">sys_mutex_lock</a>
              </li>
      

              <li>
                <a href="#sys_mutex_unlock" class="nav-sub-label">sys_mutex_unlock</a>
              </li>
      

              <li>
                <a href="#sys_mutex_free" class="nav-sub-label">sys_mutex_free</a>
              </li>
      

              <li>
                <a href="#sys_mutex_valid(mu)" class="nav-sub-label">sys_mutex_valid(mu)</a>
              </li>
      

              <li>
                <a href="#sys_mutex_set_invalid" class="nav-sub-label">sys_mutex_set_invalid</a>
              </li>
      

              <li>
                <a href="#sys_mbox_new(m, s)" class="nav-sub-label">sys_mbox_new(m, s)</a>
              </li>
      

              <li>
                <a href="#sys_mbox_fetch" class="nav-sub-label">sys_mbox_fetch</a>
              </li>
      

              <li>
                <a href="#sys_mbox_tryfetch" class="nav-sub-label">sys_mbox_tryfetch</a>
              </li>
      

              <li>
                <a href="#sys_mbox_post" class="nav-sub-label">sys_mbox_post</a>
              </li>
      

              <li>
                <a href="#sys_mbox_trypost" class="nav-sub-label">sys_mbox_trypost</a>
              </li>
      

              <li>
                <a href="#sys_mbox_free" class="nav-sub-label">sys_mbox_free</a>
              </li>
      

              <li>
                <a href="#sys_mbox_valid" class="nav-sub-label">sys_mbox_valid</a>
              </li>
      

              <li>
                <a href="#sys_mbox_valid_val" class="nav-sub-label">sys_mbox_valid_val</a>
              </li>
      

              <li>
                <a href="#sys_mbox_set_invalid" class="nav-sub-label">sys_mbox_set_invalid</a>
              </li>
      

              <li>
                <a href="#sys_mbox_set_invalid_val" class="nav-sub-label">sys_mbox_set_invalid_val</a>
              </li>
      

              <li>
                <a href="#sys_thread_new" class="nav-sub-label">sys_thread_new</a>
              </li>
      

              <li>
                <a href="#sys_msleep" class="nav-sub-label">sys_msleep</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_TIMEOUT" class="nav-sub-label">SYS_ARCH_TIMEOUT</a>
              </li>
      

              <li>
                <a href="#SYS_MBOX_EMPTY" class="nav-sub-label">SYS_MBOX_EMPTY</a>
              </li>
      

              <li>
                <a href="#LWIP_COMPAT_MUTEX" class="nav-sub-label">LWIP_COMPAT_MUTEX</a>
              </li>
      

              <li>
                <a href="#sys_mutex_t" class="nav-sub-label">sys_mutex_t</a>
              </li>
      

              <li>
                <a href="#sys_mutex_new(mutex)" class="nav-sub-label">sys_mutex_new(mutex)</a>
              </li>
      

              <li>
                <a href="#sys_mutex_lock(mutex)" class="nav-sub-label">sys_mutex_lock(mutex)</a>
              </li>
      

              <li>
                <a href="#sys_mutex_unlock(mutex)" class="nav-sub-label">sys_mutex_unlock(mutex)</a>
              </li>
      

              <li>
                <a href="#sys_mutex_free(mutex)" class="nav-sub-label">sys_mutex_free(mutex)</a>
              </li>
      

              <li>
                <a href="#sys_mutex_valid(mutex)" class="nav-sub-label">sys_mutex_valid(mutex)</a>
              </li>
      

              <li>
                <a href="#sys_mutex_set_invalid(mutex)" class="nav-sub-label">sys_mutex_set_invalid(mutex)</a>
              </li>
      

              <li>
                <a href="#sys_sem_wait(sem)" class="nav-sub-label">sys_sem_wait(sem)</a>
              </li>
      

              <li>
                <a href="#sys_sem_valid_val(sem)" class="nav-sub-label">sys_sem_valid_val(sem)</a>
              </li>
      

              <li>
                <a href="#sys_sem_set_invalid_val(sem)" class="nav-sub-label">sys_sem_set_invalid_val(sem)</a>
              </li>
      

              <li>
                <a href="#sys_mbox_tryfetch(mbox, msg)" class="nav-sub-label">sys_mbox_tryfetch(mbox, msg)</a>
              </li>
      

              <li>
                <a href="#sys_mbox_fetch(mbox, msg)" class="nav-sub-label">sys_mbox_fetch(mbox, msg)</a>
              </li>
      

              <li>
                <a href="#sys_mbox_valid_val(mbox)" class="nav-sub-label">sys_mbox_valid_val(mbox)</a>
              </li>
      

              <li>
                <a href="#sys_mbox_set_invalid_val(mbox)" class="nav-sub-label">sys_mbox_set_invalid_val(mbox)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_DECL_PROTECT(lev)" class="nav-sub-label">SYS_ARCH_DECL_PROTECT(lev)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_PROTECT(lev)" class="nav-sub-label">SYS_ARCH_PROTECT(lev)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_UNPROTECT(lev)" class="nav-sub-label">SYS_ARCH_UNPROTECT(lev)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_DECL_PROTECT" class="nav-sub-label">SYS_ARCH_DECL_PROTECT</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_PROTECT" class="nav-sub-label">SYS_ARCH_PROTECT</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_UNPROTECT" class="nav-sub-label">SYS_ARCH_UNPROTECT</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_INC(var, val)" class="nav-sub-label">SYS_ARCH_INC(var, val)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_DEC(var, val)" class="nav-sub-label">SYS_ARCH_DEC(var, val)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_GET(var, ret)" class="nav-sub-label">SYS_ARCH_GET(var, ret)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_SET(var, val)" class="nav-sub-label">SYS_ARCH_SET(var, val)</a>
              </li>
      

              <li>
                <a href="#SYS_ARCH_LOCKED(code)" class="nav-sub-label">SYS_ARCH_LOCKED(code)</a>
              </li>
      

              <li>
                <a href="#TUYA_APP_TCPIP_THREAD_PRIO_UP(prio)" class="nav-sub-label">TUYA_APP_TCPIP_THREAD_PRIO_UP(prio)</a>
              </li>
      

              <li>
                <a href="#TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio)" class="nav-sub-label">TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio)</a>
              </li>
      

              <li>
                <a href="#TUYA_APP_TCPIP_THREAD_PRIO_UP" class="nav-sub-label">TUYA_APP_TCPIP_THREAD_PRIO_UP</a>
              </li>
      

              <li>
                <a href="#TUYA_APP_TCPIP_THREAD_PRIO_BACK" class="nav-sub-label">TUYA_APP_TCPIP_THREAD_PRIO_BACK</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#sys_mutex_new" class="nav-sub-label">sys_mutex_new</a>
              </li>
      

              <li>
                <a href="#sys_mutex_lock" class="nav-sub-label">sys_mutex_lock</a>
              </li>
      

              <li>
                <a href="#sys_mutex_unlock" class="nav-sub-label">sys_mutex_unlock</a>
              </li>
      

              <li>
                <a href="#sys_mutex_free" class="nav-sub-label">sys_mutex_free</a>
              </li>
      

              <li>
                <a href="#sys_mutex_valid" class="nav-sub-label">sys_mutex_valid</a>
              </li>
      

              <li>
                <a href="#sys_mutex_set_invalid" class="nav-sub-label">sys_mutex_set_invalid</a>
              </li>
      

              <li>
                <a href="#sys_sem_new" class="nav-sub-label">sys_sem_new</a>
              </li>
      

              <li>
                <a href="#sys_sem_signal" class="nav-sub-label">sys_sem_signal</a>
              </li>
      

              <li>
                <a href="#sys_arch_sem_wait" class="nav-sub-label">sys_arch_sem_wait</a>
              </li>
      

              <li>
                <a href="#sys_sem_free" class="nav-sub-label">sys_sem_free</a>
              </li>
      

              <li>
                <a href="#sys_sem_valid" class="nav-sub-label">sys_sem_valid</a>
              </li>
      

              <li>
                <a href="#sys_sem_set_invalid" class="nav-sub-label">sys_sem_set_invalid</a>
              </li>
      

              <li>
                <a href="#sys_msleep" class="nav-sub-label">sys_msleep</a>
              </li>
      

              <li>
                <a href="#sys_mbox_new" class="nav-sub-label">sys_mbox_new</a>
              </li>
      

              <li>
                <a href="#sys_mbox_post" class="nav-sub-label">sys_mbox_post</a>
              </li>
      

              <li>
                <a href="#sys_mbox_trypost" class="nav-sub-label">sys_mbox_trypost</a>
              </li>
      

              <li>
                <a href="#sys_mbox_trypost_fromisr" class="nav-sub-label">sys_mbox_trypost_fromisr</a>
              </li>
      

              <li>
                <a href="#sys_arch_mbox_fetch" class="nav-sub-label">sys_arch_mbox_fetch</a>
              </li>
      

              <li>
                <a href="#sys_arch_mbox_tryfetch" class="nav-sub-label">sys_arch_mbox_tryfetch</a>
              </li>
      

              <li>
                <a href="#sys_mbox_free" class="nav-sub-label">sys_mbox_free</a>
              </li>
      

              <li>
                <a href="#sys_mbox_valid" class="nav-sub-label">sys_mbox_valid</a>
              </li>
      

              <li>
                <a href="#sys_mbox_set_invalid" class="nav-sub-label">sys_mbox_set_invalid</a>
              </li>
      

              <li>
                <a href="#sys_init" class="nav-sub-label">sys_init</a>
              </li>
      

              <li>
                <a href="#sys_jiffies" class="nav-sub-label">sys_jiffies</a>
              </li>
      

              <li>
                <a href="#sys_now" class="nav-sub-label">sys_now</a>
              </li>
      

              <li>
                <a href="#sys_arch_unprotect" class="nav-sub-label">sys_arch_unprotect</a>
              </li>
      

              <li>
                <a href="#tuya_app_tcpip_thread_prio_up" class="nav-sub-label">tuya_app_tcpip_thread_prio_up</a>
              </li>
      

              <li>
                <a href="#tuya_app_tcpip_thread_prio_back" class="nav-sub-label">tuya_app_tcpip_thread_prio_back</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#sys_thread_t" class="nav-sub-label">sys_thread_t</a>
              </li>
      

              <li>
                <a href="#sys_prot_t" class="nav-sub-label">sys_prot_t</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#sys_sem_t" class="nav-sub-label">sys_sem_t</a>
              </li>
      

              <li>
                <a href="#sys_mutex_t" class="nav-sub-label">sys_mutex_t</a>
              </li>
      

              <li>
                <a href="#sys_mbox_t" class="nav-sub-label">sys_mbox_t</a>
              </li>
      

              <li>
                <a href="#lwip_thread_fn" class="nav-sub-label">lwip_thread_fn</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="lwip/opt.h"><span>lwip/opt.h</span></h4>
      <pre class="doc-declare"><code>#include "lwip/opt.h"
</code></pre>
      <pre class="doc-comment">#include "lwip/opt.h"
</pre>

      <h4 id="lwip/err.h"><span>lwip/err.h</span></h4>
      <pre class="doc-declare"><code>#include "lwip/err.h"
</code></pre>
      <pre class="doc-comment">#include "lwip/err.h"
</pre>

      <h4 id="arch/sys_arch.h"><span>arch/sys_arch.h</span></h4>
      <pre class="doc-declare"><code>#include "arch/sys_arch.h"
</code></pre>
      <pre class="doc-comment">#include "arch/sys_arch.h"
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="LWIP_HDR_SYS_H">Marco <span>LWIP_HDR_SYS_H</span></h4>
      <pre class="doc-declare"><code>#define LWIP_HDR_SYS_H
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_new(s, c)">Marco <span>sys_sem_new(s, c)</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_new(s, c) ERR_OK
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_signal">Marco <span>sys_sem_signal</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_signal(s)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_wait">Marco <span>sys_sem_wait</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_wait(s)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_arch_sem_wait">Marco <span>sys_arch_sem_wait</span></h4>
      <pre class="doc-declare"><code>#define sys_arch_sem_wait(s,t)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_free">Marco <span>sys_sem_free</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_free(s)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_valid(s)">Marco <span>sys_sem_valid(s)</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_valid(s) 0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_valid_val(s)">Marco <span>sys_sem_valid_val(s)</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_valid_val(s) 0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_set_invalid">Marco <span>sys_sem_set_invalid</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_set_invalid(s)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_set_invalid_val">Marco <span>sys_sem_set_invalid_val</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_set_invalid_val(s)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_new(mu)">Marco <span>sys_mutex_new(mu)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_new(mu) ERR_OK
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_lock">Marco <span>sys_mutex_lock</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_lock(mu)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_unlock">Marco <span>sys_mutex_unlock</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_unlock(mu)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_free">Marco <span>sys_mutex_free</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_free(mu)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_valid(mu)">Marco <span>sys_mutex_valid(mu)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_valid(mu) 0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_set_invalid">Marco <span>sys_mutex_set_invalid</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_set_invalid(mu)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_new(m, s)">Marco <span>sys_mbox_new(m, s)</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_new(m, s) ERR_OK
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_fetch">Marco <span>sys_mbox_fetch</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_fetch(m,d)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_tryfetch">Marco <span>sys_mbox_tryfetch</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_tryfetch(m,d)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_post">Marco <span>sys_mbox_post</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_post(m,d)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_trypost">Marco <span>sys_mbox_trypost</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_trypost(m,d)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_free">Marco <span>sys_mbox_free</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_free(m)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_valid">Marco <span>sys_mbox_valid</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_valid(m)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_valid_val">Marco <span>sys_mbox_valid_val</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_valid_val(m)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_set_invalid">Marco <span>sys_mbox_set_invalid</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_set_invalid(m)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_set_invalid_val">Marco <span>sys_mbox_set_invalid_val</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_set_invalid_val(m)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_thread_new">Marco <span>sys_thread_new</span></h4>
      <pre class="doc-declare"><code>#define sys_thread_new(n,t,a,s,p)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_msleep">Marco <span>sys_msleep</span></h4>
      <pre class="doc-declare"><code>#define sys_msleep(t)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_TIMEOUT">Marco <span>SYS_ARCH_TIMEOUT</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_TIMEOUT 0xffffffffUL
</code></pre>
      <pre class="doc-comment">/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */</pre>

      <h4 id="SYS_MBOX_EMPTY">Marco <span>SYS_MBOX_EMPTY</span></h4>
      <pre class="doc-declare"><code>#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT
</code></pre>
      <pre class="doc-comment">/** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate.
 * For now we use the same magic value, but we allow this to change in future.
 */</pre>

      <h4 id="LWIP_COMPAT_MUTEX">Marco <span>LWIP_COMPAT_MUTEX</span></h4>
      <pre class="doc-declare"><code>#define LWIP_COMPAT_MUTEX 0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_t">Marco <span>sys_mutex_t</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_t                  sys_sem_t
</code></pre>
      <pre class="doc-comment">/* for old ports that don't have mutexes: define them to binary semaphores */</pre>

      <h4 id="sys_mutex_new(mutex)">Marco <span>sys_mutex_new(mutex)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_new(mutex)         sys_sem_new(mutex, 1)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_lock(mutex)">Marco <span>sys_mutex_lock(mutex)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_lock(mutex)        sys_sem_wait(mutex)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_unlock(mutex)">Marco <span>sys_mutex_unlock(mutex)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_unlock(mutex)      sys_sem_signal(mutex)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_free(mutex)">Marco <span>sys_mutex_free(mutex)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_free(mutex)        sys_sem_free(mutex)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_valid(mutex)">Marco <span>sys_mutex_valid(mutex)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_valid(mutex)       sys_sem_valid(mutex)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mutex_set_invalid(mutex)">Marco <span>sys_mutex_set_invalid(mutex)</span></h4>
      <pre class="doc-declare"><code>#define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_sem_wait(sem)">Marco <span>sys_sem_wait(sem)</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_wait(sem)                 sys_arch_sem_wait(sem, 0)
</code></pre>
      <pre class="doc-comment">/** Wait for a semaphore - forever/no timeout */</pre>

      <h4 id="sys_sem_valid_val(sem)">Marco <span>sys_sem_valid_val(sem)</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_valid_val(sem)      sys_sem_valid(&(sem))
</code></pre>
      <pre class="doc-comment">/**
 * Same as sys_sem_valid() but taking a value, not a pointer
 */</pre>

      <h4 id="sys_sem_set_invalid_val(sem)">Marco <span>sys_sem_set_invalid_val(sem)</span></h4>
      <pre class="doc-declare"><code>#define sys_sem_set_invalid_val(sem) sys_sem_set_invalid(&(sem))
</code></pre>
      <pre class="doc-comment">/**
 * Same as sys_sem_set_invalid() but taking a value, not a pointer
 */</pre>

      <h4 id="sys_mbox_tryfetch(mbox, msg)">Marco <span>sys_mbox_tryfetch(mbox, msg)</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg)
</code></pre>
      <pre class="doc-comment">/**
 * For now, we map straight to sys_arch implementation.
 */</pre>

      <h4 id="sys_mbox_fetch(mbox, msg)">Marco <span>sys_mbox_fetch(mbox, msg)</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_valid_val(mbox)">Marco <span>sys_mbox_valid_val(mbox)</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_valid_val(mbox)      sys_mbox_valid(&(mbox))
</code></pre>
      <pre class="doc-comment">/**
 * Same as sys_mbox_valid() but taking a value, not a pointer
 */</pre>

      <h4 id="sys_mbox_set_invalid_val(mbox)">Marco <span>sys_mbox_set_invalid_val(mbox)</span></h4>
      <pre class="doc-declare"><code>#define sys_mbox_set_invalid_val(mbox) sys_mbox_set_invalid(&(mbox))
</code></pre>
      <pre class="doc-comment">/**
 * Same as sys_mbox_set_invalid() but taking a value, not a pointer
 */</pre>

      <h4 id="SYS_ARCH_DECL_PROTECT(lev)">Marco <span>SYS_ARCH_DECL_PROTECT(lev)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev
</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_prot
 * SYS_ARCH_DECL_PROTECT
 * declare a protection variable. This macro will default to defining a variable of
 * type sys_prot_t. If a particular port needs a different implementation, then
 * this macro may be defined in sys_arch.h.
 */</pre>

      <h4 id="SYS_ARCH_PROTECT(lev)">Marco <span>SYS_ARCH_PROTECT(lev)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()
</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_prot
 * SYS_ARCH_PROTECT
 * Perform a "fast" protect. This could be implemented by
 * disabling interrupts for an embedded system or by using a semaphore or
 * mutex. The implementation should allow calling SYS_ARCH_PROTECT when
 * already protected. The old protection level is returned in the variable
 * "lev". This macro will default to calling the sys_arch_protect() function
 * which should be implemented in sys_arch.c. If a particular port needs a
 * different implementation, then this macro may be defined in sys_arch.h
 */</pre>

      <h4 id="SYS_ARCH_UNPROTECT(lev)">Marco <span>SYS_ARCH_UNPROTECT(lev)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)
</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_prot
 * SYS_ARCH_UNPROTECT
 * Perform a "fast" set of the protection level to "lev". This could be
 * implemented by setting the interrupt level to "lev" within the MACRO or by
 * using a semaphore or mutex.  This macro will default to calling the
 * sys_arch_unprotect() function which should be implemented in
 * sys_arch.c. If a particular port needs a different implementation, then
 * this macro may be defined in sys_arch.h
 */</pre>

      <h4 id="SYS_ARCH_DECL_PROTECT">Marco <span>SYS_ARCH_DECL_PROTECT</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_DECL_PROTECT(lev)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_PROTECT">Marco <span>SYS_ARCH_PROTECT</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_PROTECT(lev)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_UNPROTECT">Marco <span>SYS_ARCH_UNPROTECT</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_UNPROTECT(lev)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_INC(var, val)">Marco <span>SYS_ARCH_INC(var, val)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_INC(var, val) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               var += val; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_DEC(var, val)">Marco <span>SYS_ARCH_DEC(var, val)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_DEC(var, val) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               var -= val; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_GET(var, ret)">Marco <span>SYS_ARCH_GET(var, ret)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_GET(var, ret) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               ret = var; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_SET(var, val)">Marco <span>SYS_ARCH_SET(var, val)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_SET(var, val) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               var = val; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="SYS_ARCH_LOCKED(code)">Marco <span>SYS_ARCH_LOCKED(code)</span></h4>
      <pre class="doc-declare"><code>#define SYS_ARCH_LOCKED(code) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               code; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="TUYA_APP_TCPIP_THREAD_PRIO_UP(prio)">Marco <span>TUYA_APP_TCPIP_THREAD_PRIO_UP(prio)</span></h4>
      <pre class="doc-declare"><code>#define TUYA_APP_TCPIP_THREAD_PRIO_UP(prio) tuya_app_tcpip_thread_prio_up(prio)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio)">Marco <span>TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio)</span></h4>
      <pre class="doc-declare"><code>#define TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio) tuya_app_tcpip_thread_prio_back(prio)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="TUYA_APP_TCPIP_THREAD_PRIO_UP">Marco <span>TUYA_APP_TCPIP_THREAD_PRIO_UP</span></h4>
      <pre class="doc-declare"><code>#define TUYA_APP_TCPIP_THREAD_PRIO_UP(prio)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="TUYA_APP_TCPIP_THREAD_PRIO_BACK">Marco <span>TUYA_APP_TCPIP_THREAD_PRIO_BACK</span></h4>
      <pre class="doc-declare"><code>#define TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio)
</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="sys_mutex_new">Func <span>sys_mutex_new</span></h4>
      <pre class="doc-declare"><code>err_t sys_mutex_new(sys_mutex_t *mutex);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mutex
 * Create a new mutex.
 * Note that mutexes are expected to not be taken recursively by the lwIP code,
 * so both implementation types (recursive or non-recursive) should work.
 * The mutex is allocated to the memory that 'mutex'
 * points to (which can be both a pointer or the actual OS structure).
 * If the mutex has been created, ERR_OK should be returned. Returning any
 * other error will provide a hint what went wrong, but except for assertions,
 * no real error handling is implemented.
 * 
 * @param mutex pointer to the mutex to create
 * @return ERR_OK if successful, another err_t otherwise
 */</pre>

      <h4 id="sys_mutex_lock">Func <span>sys_mutex_lock</span></h4>
      <pre class="doc-declare"><code>void sys_mutex_lock(sys_mutex_t *mutex);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mutex
 * Blocks the thread until the mutex can be grabbed.
 * @param mutex the mutex to lock
 */</pre>

      <h4 id="sys_mutex_unlock">Func <span>sys_mutex_unlock</span></h4>
      <pre class="doc-declare"><code>void sys_mutex_unlock(sys_mutex_t *mutex);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mutex
 * Releases the mutex previously locked through 'sys_mutex_lock()'.
 * @param mutex the mutex to unlock
 */</pre>

      <h4 id="sys_mutex_free">Func <span>sys_mutex_free</span></h4>
      <pre class="doc-declare"><code>void sys_mutex_free(sys_mutex_t *mutex);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mutex
 * Deallocates a mutex.
 * @param mutex the mutex to delete
 */</pre>

      <h4 id="sys_mutex_valid">Func <span>sys_mutex_valid</span></h4>
      <pre class="doc-declare"><code>int sys_mutex_valid(sys_mutex_t *mutex);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mutex
 * Returns 1 if the mutes is valid, 0 if it is not valid.
 * When using pointers, a simple way is to check the pointer for != NULL.
 * When directly using OS structures, implementing this may be more complex.
 * This may also be a define, in which case the function is not prototyped.
 */</pre>

      <h4 id="sys_mutex_set_invalid">Func <span>sys_mutex_set_invalid</span></h4>
      <pre class="doc-declare"><code>void sys_mutex_set_invalid(sys_mutex_t *mutex);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mutex
 * Invalidate a mutex so that sys_mutex_valid() returns 0.
 * ATTENTION: This does NOT mean that the mutex shall be deallocated:
 * sys_mutex_free() is always called before calling this function!
 * This may also be a define, in which case the function is not prototyped.
 */</pre>

      <h4 id="sys_sem_new">Func <span>sys_sem_new</span></h4>
      <pre class="doc-declare"><code>err_t sys_sem_new(sys_sem_t *sem, u8_t count);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_sem
 * Create a new semaphore
 * Creates a new semaphore. The semaphore is allocated to the memory that 'sem'
 * points to (which can be both a pointer or the actual OS structure).
 * The "count" argument specifies the initial state of the semaphore (which is
 * either 0 or 1).
 * If the semaphore has been created, ERR_OK should be returned. Returning any
 * other error will provide a hint what went wrong, but except for assertions,
 * no real error handling is implemented.
 *
 * @param sem pointer to the semaphore to create
 * @param count initial count of the semaphore
 * @return ERR_OK if successful, another err_t otherwise
 */</pre>

      <h4 id="sys_sem_signal">Func <span>sys_sem_signal</span></h4>
      <pre class="doc-declare"><code>void sys_sem_signal(sys_sem_t *sem);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_sem
 * Signals a semaphore
 * @param sem the semaphore to signal
 */</pre>

      <h4 id="sys_arch_sem_wait">Func <span>sys_arch_sem_wait</span></h4>
      <pre class="doc-declare"><code>u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_sem
 *  Blocks the thread while waiting for the semaphore to be signaled. If the
 * "timeout" argument is non-zero, the thread should only be blocked for the
 * specified time (measured in milliseconds). If the "timeout" argument is zero,
 * the thread should be blocked until the semaphore is signalled.
 * 
 * The return value is SYS_ARCH_TIMEOUT if the semaphore wasn't signaled within
 * the specified time or any other value if it was signaled (with or without
 * waiting).
 * Notice that lwIP implements a function with a similar name,
 * sys_sem_wait(), that uses the sys_arch_sem_wait() function.
 * 
 * @param sem the semaphore to wait for
 * @param timeout timeout in milliseconds to wait (0 = wait forever)
 * @return SYS_ARCH_TIMEOUT on timeout, any other value on success
 */</pre>

      <h4 id="sys_sem_free">Func <span>sys_sem_free</span></h4>
      <pre class="doc-declare"><code>void sys_sem_free(sys_sem_t *sem);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_sem
 * Deallocates a semaphore.
 * @param sem semaphore to delete
 */</pre>

      <h4 id="sys_sem_valid">Func <span>sys_sem_valid</span></h4>
      <pre class="doc-declare"><code>int sys_sem_valid(sys_sem_t *sem);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_sem
 * Returns 1 if the semaphore is valid, 0 if it is not valid.
 * When using pointers, a simple way is to check the pointer for != NULL.
 * When directly using OS structures, implementing this may be more complex.
 * This may also be a define, in which case the function is not prototyped.
 */</pre>

      <h4 id="sys_sem_set_invalid">Func <span>sys_sem_set_invalid</span></h4>
      <pre class="doc-declare"><code>void sys_sem_set_invalid(sys_sem_t *sem);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_sem
 * Invalidate a semaphore so that sys_sem_valid() returns 0.
 * ATTENTION: This does NOT mean that the semaphore shall be deallocated:
 * sys_sem_free() is always called before calling this function!
 * This may also be a define, in which case the function is not prototyped.
 */</pre>

      <h4 id="sys_msleep">Func <span>sys_msleep</span></h4>
      <pre class="doc-declare"><code>void sys_msleep(u32_t ms);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_misc
 * Sleep for specified number of ms
 */</pre>

      <h4 id="sys_mbox_new">Func <span>sys_mbox_new</span></h4>
      <pre class="doc-declare"><code>err_t sys_mbox_new(sys_mbox_t *mbox, int size);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Creates an empty mailbox for maximum "size" elements. Elements stored
 * in mailboxes are pointers. You have to define macros "_MBOX_SIZE"
 * in your lwipopts.h, or ignore this parameter in your implementation
 * and use a default size.
 * If the mailbox has been created, ERR_OK should be returned. Returning any
 * other error will provide a hint what went wrong, but except for assertions,
 * no real error handling is implemented.
 * 
 * @param mbox pointer to the mbox to create
 * @param size (minimum) number of messages in this mbox
 * @return ERR_OK if successful, another err_t otherwise
 */</pre>

      <h4 id="sys_mbox_post">Func <span>sys_mbox_post</span></h4>
      <pre class="doc-declare"><code>void sys_mbox_post(sys_mbox_t *mbox, void *msg);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Post a message to an mbox - may not fail
 * -> blocks if full, only to be used from tasks NOT from ISR!
 * 
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL)
 */</pre>

      <h4 id="sys_mbox_trypost">Func <span>sys_mbox_trypost</span></h4>
      <pre class="doc-declare"><code>err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Try to post a message to an mbox - may fail if full.
 * Can be used from ISR (if the sys arch layer allows this).
 * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
 * 
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL)
 */</pre>

      <h4 id="sys_mbox_trypost_fromisr">Func <span>sys_mbox_trypost_fromisr</span></h4>
      <pre class="doc-declare"><code>err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Try to post a message to an mbox - may fail if full.
 * To be be used from ISR.
 * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
 * 
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL)
 */</pre>

      <h4 id="sys_arch_mbox_fetch">Func <span>sys_arch_mbox_fetch</span></h4>
      <pre class="doc-declare"><code>u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Blocks the thread until a message arrives in the mailbox, but does
 * not block the thread longer than "timeout" milliseconds (similar to
 * the sys_arch_sem_wait() function). If "timeout" is 0, the thread should
 * be blocked until a message arrives. The "msg" argument is a result
 * parameter that is set by the function (i.e., by doing "*msg =
 * ptr"). The "msg" parameter maybe NULL to indicate that the message
 * should be dropped.
 * The return values are the same as for the sys_arch_sem_wait() function:
 * SYS_ARCH_TIMEOUT if there was a timeout, any other value if a messages
 * is received.
 * 
 * Note that a function with a similar name, sys_mbox_fetch(), is
 * implemented by lwIP. 
 * 
 * @param mbox mbox to get a message from
 * @param msg pointer where the message is stored
 * @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever)
 * @return SYS_ARCH_TIMEOUT on timeout, any other value if a message has been received
 */</pre>

      <h4 id="sys_arch_mbox_tryfetch">Func <span>sys_arch_mbox_tryfetch</span></h4>
      <pre class="doc-declare"><code>u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * This is similar to sys_arch_mbox_fetch, however if a message is not
 * present in the mailbox, it immediately returns with the code
 * SYS_MBOX_EMPTY. On success 0 is returned.
 * To allow for efficient implementations, this can be defined as a
 * function-like macro in sys_arch.h instead of a normal function. For
 * example, a naive implementation could be:
 * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1)
 * although this would introduce unnecessary delays.
 * 
 * @param mbox mbox to get a message from
 * @param msg pointer where the message is stored
 * @return 0 (milliseconds) if a message has been received
 *         or SYS_MBOX_EMPTY if the mailbox is empty
 */</pre>

      <h4 id="sys_mbox_free">Func <span>sys_mbox_free</span></h4>
      <pre class="doc-declare"><code>void sys_mbox_free(sys_mbox_t *mbox);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Deallocates a mailbox. If there are messages still present in the
 * mailbox when the mailbox is deallocated, it is an indication of a
 * programming error in lwIP and the developer should be notified.
 * 
 * @param mbox mbox to delete
 */</pre>

      <h4 id="sys_mbox_valid">Func <span>sys_mbox_valid</span></h4>
      <pre class="doc-declare"><code>int sys_mbox_valid(sys_mbox_t *mbox);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Returns 1 if the mailbox is valid, 0 if it is not valid.
 * When using pointers, a simple way is to check the pointer for != NULL.
 * When directly using OS structures, implementing this may be more complex.
 * This may also be a define, in which case the function is not prototyped.
 */</pre>

      <h4 id="sys_mbox_set_invalid">Func <span>sys_mbox_set_invalid</span></h4>
      <pre class="doc-declare"><code>void sys_mbox_set_invalid(sys_mbox_t *mbox);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_mbox
 * Invalidate a mailbox so that sys_mbox_valid() returns 0.
 * ATTENTION: This does NOT mean that the mailbox shall be deallocated:
 * sys_mbox_free() is always called before calling this function!
 * This may also be a define, in which case the function is not prototyped.
 */</pre>

      <h4 id="sys_init">Func <span>sys_init</span></h4>
      <pre class="doc-declare"><code>void sys_init(void);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_misc
 * sys_init() must be called before anything else.
 * Initialize the sys_arch layer.
 */</pre>

      <h4 id="sys_jiffies">Func <span>sys_jiffies</span></h4>
      <pre class="doc-declare"><code>u32_t sys_jiffies(void);</code></pre>
      <pre class="doc-comment">/**
 * Ticks/jiffies since power up.
 */</pre>

      <h4 id="sys_now">Func <span>sys_now</span></h4>
      <pre class="doc-declare"><code>u32_t sys_now(void);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_time
 * Returns the current time in milliseconds,
 * may be the same as sys_jiffies or at least based on it.
 * Don't care for wraparound, this is only used for time diffs.
 * Not implementing this function means you cannot use some modules (e.g. TCP
 * timestamps, internal timeouts for NO_SYS==1).
 */</pre>

      <h4 id="sys_arch_unprotect">Func <span>sys_arch_unprotect</span></h4>
      <pre class="doc-declare"><code>void sys_arch_unprotect(sys_prot_t pval);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="tuya_app_tcpip_thread_prio_up">Func <span>tuya_app_tcpip_thread_prio_up</span></h4>
      <pre class="doc-declare"><code>void tuya_app_tcpip_thread_prio_up(u32_t *prio_thread);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="tuya_app_tcpip_thread_prio_back">Func <span>tuya_app_tcpip_thread_prio_back</span></h4>
      <pre class="doc-declare"><code>void tuya_app_tcpip_thread_prio_back(u32_t prio_thread);</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="vars">Vars</h3>
      

      <h4 id="sys_thread_t">Variable <span>sys_thread_t</span></h4>
      <pre class="doc-declare"><code>sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio);</code></pre>
      <pre class="doc-comment">/**
 * @ingroup sys_misc
 * The only thread function:
 * Starts a new thread named "name" with priority "prio" that will begin its
 * execution in the function "thread()". The "arg" argument will be passed as an
 * argument to the thread() function. The stack size to used for this thread is
 * the "stacksize" parameter. The id of the new thread is returned. Both the id
 * and the priority are system dependent.
 * ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!)
 * 
 * @param name human-readable name for the thread (used for debugging purposes)
 * @param thread thread-function
 * @param arg parameter passed to 'thread'
 * @param stacksize stack size in bytes for the new thread (may be ignored by ports)
 * @param prio priority of the new thread (may be ignored by ports) */</pre>

      <h4 id="sys_prot_t">Variable <span>sys_prot_t</span></h4>
      <pre class="doc-declare"><code>sys_prot_t sys_arch_protect(void);</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="consts">Consts</h3>
      
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="sys_sem_t">Typedef <span>sys_sem_t</span></h4>
      <pre class="doc-declare"><code>typedef u8_t sys_sem_t;
</code></pre>
      <pre class="doc-comment">/* For a totally minimal and standalone system, we provide null
   definitions of the sys_ functions. */</pre>

      <h4 id="sys_mutex_t">Typedef <span>sys_mutex_t</span></h4>
      <pre class="doc-declare"><code>typedef u8_t sys_mutex_t;
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="sys_mbox_t">Typedef <span>sys_mbox_t</span></h4>
      <pre class="doc-declare"><code>typedef u8_t sys_mbox_t;
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="lwip_thread_fn">Typedef <span>lwip_thread_fn</span></h4>
      <pre class="doc-declare"><code>typedef void (*lwip_thread_fn)(void *arg);
</code></pre>
      <pre class="doc-comment">/** Function prototype for thread functions */</pre>
    </div>
  </body>
</html>
            